Colour Contrast Checker
WCAG AA and AAA, checked on real text
Check the contrast ratio between text and background against WCAG AA and AAA, preview it on real text, and nudge the colour until it passes.
WCAG AA and AAA, checked on real text
Enter a text colour and background with the colour picker or a hex code (#RGB or #RRGGBB), and it calculates the contrast ratio and shows pass or fail for WCAG AA and AAA, separately for normal and large text. A preview box draws the actual combination, and if it falls short of AA for body text (4.5:1) a button appears that adjusts the text colour automatically. Use it when choosing colours for web or app design, slides or notices.
Each RGB value is scaled to 0 to 1 and gamma is undone (values up to 0.03928 are divided by 12.92; larger ones become ((value + 0.055) ÷ 1.055) to the power 2.4), then weighted by 0.2126 red, 0.7152 green and 0.0722 blue to get relative luminance. The ratio is (lighter luminance + 0.05) ÷ (darker luminance + 0.05), from 1:1 to 21:1. For example, the default grey #6B7280 on white is 4.83:1, passing AA for normal text but failing AAA (7:1). #999999 is 2.85:1, failing even the large-text threshold (3:1). The auto-adjust button moves the text colour's R, G and B by 1 at a time, darker on a light background or lighter on a dark one, and stops at the first colour above 4.5:1.
Many accessibility regulations and public standards require AA. AAA is a stricter recommendation, often targeted for long body text or public services. Requirements vary by organisation and law and can change.
#767676 at about 4.54:1 is the grey closest to the AA normal-text threshold. Anything lighter fails, so keep even secondary text at or below that lightness.
A common approach is to use the brand colour for backgrounds or accents and switch the text on it to a high-contrast colour. You can also use auto-adjust to find a darker or lighter variant.
Passing the threshold comes first, but some find very strong contrast such as pure black on pure white tiring for long reading. Softening it a little while still passing is fine.
Posts · 0
No posts yet.